package com.bamanker.dailylove.config;

import com.bamanker.dailylove.controller.PushDailyController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class PushTask {

    @Autowired
    PushDailyController pushDailyController;

    //每日 早上7.30,晚上22点 定时推送
    @Scheduled(cron = "0 30 7 * * ?")
    public void scheduledPushMorning(){
        pushDailyController.pushMorning();
    }

    @Scheduled(cron = "0 0 22 * * ?")
    public void scheduledPushNight(){
        pushDailyController.pushNight();
    }
}
